package com.wl.vcode.web;

import com.wl.bean.Result;
import com.wl.vcode.VcodeException;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

// AOP 实现的异常拦截
@Component
@RestControllerAdvice
public class ExHandler {

    @ExceptionHandler(VcodeException.class)
    Object handleVcodeException(VcodeException e){
        return new Result(0,e.getMessage(),null);
    }

}
